package cs4383;

import javax.media.j3d.BranchGroup;
import javax.media.j3d.TransformGroup;
import javax.swing.ImageIcon;

public class Furniture {

	private TransformGroup modelTg;
	private BranchGroup bg = new BranchGroup();
	private String name;
	private String designer;
	private String features;
	private String description;
	private double price;
	private float width;
	private float height;
	private String category;
	private ImageIcon ico;

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public Furniture(String model, double scale, boolean hasCoords) {
		modelTg = ModelHelper.loadModel(model, scale, hasCoords);
		bg.addChild(modelTg);
		bg.setCapability(BranchGroup.ALLOW_DETACH);
	}

	public BranchGroup getBranchGroup() {
		return (BranchGroup) bg.cloneTree();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesigner() {
		return designer;
	}

	public void setDesigner(String designer) {
		this.designer = designer;
	}

	public String getFeatures() {
		return features;
	}

	public void setFeatures(String features) {
		this.features = features;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public ImageIcon getImageIcon() {
		return ico;
	}

	public void setImageIcon(ImageIcon ico) {
		this.ico = ico;
	}

	public void setHeight(float height) {
		this.height = height;
	}

	public float getHeight() {
		return height;
	}

	public void setWidth(float width) {
		this.width = width;
	}

	public float getWidth() {
		return width;
	}

	public void setScale(float scale) {
		float h = height * scale;
		setHeight(height + h);
		float w = width * scale;
		setWidth(width + w);

	}

}
